import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:nordic_otas_plugin/nordic_otas_plugin.dart';
import 'package:nordic_otas_plugin/rtk_status.dart';
import 'nordic_otas_plugin_platform_interface.dart';
class MethodChannelNordicOtasPlugin extends NordicOtasPluginPlatform {

  @visibleForTesting
  final methodChannel = const MethodChannel('nordic_otas_plugin');

  @override
  Future<String?> getPlatformVersion() async {
    final version = await methodChannel.invokeMethod<String>('getPlatformVersion');
    return version;
  }

  @override
  void setFilePath(String path) {
    methodChannel.invokeMethod("setFilePath",{"path":path});
  }

  Future<bool> notice() async{
    bool flag =  await methodChannel.invokeMethod("notice");
    return flag;
  }

  @override
  void startOta() {
    methodChannel.invokeMethod("startOta");
  }

  void startAndroidOta(String name,String address) {
    methodChannel.invokeMethod("startAndroidOta",{"name":name,"address":address});
  }

  @override
  void otaListener(Future<dynamic> Function(MethodCall call)? handler){
    methodChannel.setMethodCallHandler(handler);
  }

}
